<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/m/include/init_mobile.jsp" %>
<%@ page import="com.qbooks.member.*" %>
<%
	if (session_user_id.equals("")) {
		response.sendRedirect("/m/member/login.jsp?os="+os);
		return;
	}

	HashMap param = new HashMap();
	param.put("member_id", session_user_id);
	
	MemberDAO dao = new MemberDAO();
	HashList list = dao.selectMemberSalesList(param);
	
%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	<title><%= HOME_NAME %></title>
	<%@ include file="/m/include/cssnjs.jsp"  %>
	<link rel="stylesheet" href="/css/jquery.mobile-1.4.2.min.css"/>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#header-nav li:nth-child(4)').addClass('on');
	});
	
	
	function fnGoMemberUpdate() {
		document.location.href = "./memberUpdate.jsp?os=<%=os%>";
	}
	
	function fnGoDeviceList() {
		document.location.href = "./deviceList.jsp?os=<%=os%>";
	}
	
	</script>
</head>
<body>
	<div id="wrap">
		<%@ include file="/m/include/header.jsp"  %>
		<div id="contents" class="ui-page-theme-a">
			
			<h2>구매내역</h2>
			<div id="login">
				
			<%	if (list.size() > 0) { %>
			
					<strong>총 <%= list.size() %>건의 구매이력이 있습니다.</strong><br/><br/>
					
					<ul class="listview">
					<%	for (int i = 0; i < list.size(); i++) { %>
							<li class="model <%=i==0?"first":""%>">
								<div class="sales_dt"><%= list.getDate("sales_dt",i) %></div>
								<span>
						<%		if ("0".equals(list.get("pay_method",i))) {	%>
									쿠폰구매
						<%		} else {	%>
									<%= list.getPrice("price",i) %>원
						<%		} %>
								</span> 
								<div><%= list.get("book_name",i) %></div>
							</li>
					<%	} %>
		        	</ul>
			
			<%	} else { %>
			
					<strong>구매이력이 없습니다.</strong>
			
			<%	} %>
	        	
			</div>
		</div>
		<%@ include file="/m/include/footer.jsp"  %>
	</div>

</body>

</html>









